package projetDames.graphique;

import java.io.File;
import java.io.Serializable;
import javax.swing.filechooser.FileFilter;

public class myFileFilter extends FileFilter implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String extension;
	private String description;

	public myFileFilter(String e, String d) {
		this.extension = e;
		this.description = d;
	}

	public boolean accept(File file) {
		return (file.isDirectory() || file.getName().endsWith(this.extension));
	}

	public String getDescription() {
		return this.extension + " - " + this.description;
	}
}
